package com.jimmy.medical.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 会员类型包含的服务项目和默认次数
 * 定义了某种会员类别下某个服务项目的默认次数和每次服务的收费
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "member_type_service_item")
public class MemberTypeServiceItem extends AbstractEntity {
	/** 会员类型*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "member_type_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private MemberType memberType;
	/** 服务项目*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "service_item_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private ServiceItem item;
	/** 次数*/
	@Column(name = "counts")
	private int counts;
	/** 金额*/
	@Column(name = "money")
	private int money;
	
	public MemberType getMemberType() {
		return memberType;
	}
	public void setMemberType(MemberType memberType) {
		this.memberType = memberType;
	}
	public ServiceItem getItem() {
		return item;
	}
	public void setItem(ServiceItem item) {
		this.item = item;
	}
	public int getCounts() {
		return counts;
	}
	public void setCounts(int counts) {
		this.counts = counts;
	}
	public int getMoney() {
		return money;
	}
	public void setMoney(int money) {
		this.money = money;
	}
}
